﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data.SQLiteProvider;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            // var uow = new Infrastructure.Data.Uow.UnitOfWorkContext();
            // Domain.Uow.IRepository<Domain.Entity.MobileClient> client = new Infrastructure.Data.Uow.EfRepository<
            //  Domain.Entity.MobileClient>(uow);
            //var repeat client.GetList().OrderBy(d => d.DeviceToken).GroupBy(d => d.DeviceToken).Select(d => d.Key).ToList();
            //Sqlite();
        }

        private static void Sqlite()
        {
            var url = "http://imap.ipow.cn/clientdb/downclientdb/?userName=imapOpenUser&pwd=123456";
            System.Net.WebClient client = new System.Net.WebClient();
            var data = client.DownloadData(url);
            var path = AppDomain.CurrentDomain.BaseDirectory;
            path = System.IO.Path.Combine(path, "clientdb.sqlite");
            var fs = new System.IO.FileStream(path, System.IO.FileMode.CreateNew, System.IO.FileAccess.Write);
            fs.Write(data, 0, data.Length);
            fs.Close();
            fs.Dispose();
        }
    }
}
